package uk.co.hephistocles.blobGame;

import com.badlogic.gdx.math.Vector2;

public class GreenStar implements Collectible{
	Vector2 pos;
	int radius;
	private boolean collected;
	private Character 	sprite;
	
	public GreenStar(int x, int y, int radius, Character sprt) {
		pos = new Vector2(x,y);
		this.radius = radius;
    	this.sprite = new Character(sprt);
    	sprite.randomFrame();
    	sprite.setOrigin(10,40);
	}

	@Override
	public boolean collides(Vector2 pt) {
		if (radius > pos.dst(pt)) {
			handle();
			return true;
		}
		return false;
	}

	@Override
	public void handle() {
		System.out.println("I gotsed the EPISTAR!");
		collected = true;
	}

	public void draw() {
		sprite.draw((int)pos.x,(int) pos.y);
	}

	@Override
	public void update() {
		sprite.update();
	}

	public boolean isCollected() {
		return collected;
	}

}
